﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZFB.Models.EntityConfig
{
    public class PermissionsConfig:IEntityTypeConfiguration<T_Permissions>
    {
        public void Configure(EntityTypeBuilder<T_Permissions> builder) 
        {
            builder.ToTable("T_Permissions");
            
            builder.HasMany(e=>e.T_Roles).WithMany(e=>e.T_Permissions).UsingEntity(m => m.ToTable("T_RolePermissions"));
        }


    }
}
